package com.sl.biz.modular.workflow.controller;


import com.sl.biz.modular.ai.controller.domain.request.AiGenerateEntityRequest;
import com.sl.biz.modular.workflow.domain.dto.WorkflowContentDTO;
import com.sl.biz.modular.workflow.service.WorkflowContentBizService;
import com.sl.core.domain.vo.ProcessFrontDefineBaseVO;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/work_flow/content")
@RequiredArgsConstructor
public class WorkflowContentController {

    private final WorkflowContentBizService workflowContentBizService;
    @PostMapping("/save")
    public Boolean save(@RequestBody @Validated WorkflowContentDTO workflowContentDO) {
        return workflowContentBizService.save(workflowContentDO);
    }

    @PostMapping("/get_by_workflow_id")
    public WorkflowContentDTO getByWorkflowId(@RequestBody @Validated WorkflowContentDTO workflowContentDO) {
        return workflowContentBizService.getByWorkflowId(workflowContentDO);
    }

    @PostMapping("/ai_generate_process_file")
    public ProcessFrontDefineBaseVO aiGenerateProcessFile(@RequestBody AiGenerateEntityRequest aiGenerateEntityRequest){
        return workflowContentBizService.aiGenerateProcessFile(aiGenerateEntityRequest);
    }
}
